import java.util.*;

/**
 * @author LKQ
 * @date 2022/6/11 11:47
 * @description
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextLine()) {
            int N = sc.nextInt();
            sc.nextLine();
            List<String> list = new ArrayList<>();
            for (int i = 0; i < N; i++) {
                list.add(sc.nextLine());
            }
            Collections.sort(list);
            for (int i = 0; i < N; i++) {
                System.out.println(list.get(i));
            }
        }
    }
}
